<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>07 v-on</title>
</head>
<body>
  <div id="app">
   <!-- 
     key属性具有唯一性
     v-for = " item of list " :key="item"
     v-for = " item in list " :key="item"
     v-for = " (item, index) of list" :key = "index"
    -->
    <ul>
      <li v-for="item in list">
        {{ item }}
      </li>
    </ul>
    <ul>
      <li v-for="item of arr">
        {{ item.a }} * {{ item.b }} = {{ item.a * item.b }}
      </li> 
    </ul>
    <h3>有key</h3>
    <ul>
      <li v-for="item in list" :key="item">
        {{ item }}
      </li>
    </ul>
  </div>
</body>
<script src="lib/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      list: ['a', 'b', 'c', 'd'],
      arr: [
        {
          a: 1,
          b: 1
        },
        {
          a: 2,
          b: 2
        }
      ]
    }
  })
</script>
</html>
